<?php

class Category  implements ViewObject{
    public $cat_id;
    public $cat_name;
    public $keywords;
    public $cat_desc;
    public $parent_id;
    public $sort_order;
    public $template_file;
    public $measure_unit;
    public $show_in_nav;
    public $style;
    public $is_show;
    public $grade;
    public $filter_attr;  
    public $url;
    public $goods_list;
    public $cat_img;
    public $article_list;
    public $goods_count;    
    public $message_list;    
    public $subCategories = array();
    public function addSubCategory($cat) {
        $this->subCategories[] = $cat;
    }
    
    public function getUrl() {
        return $this->url;
    }
    
    public function isLeaf() {
        if(count($this->subCategories) == 0) {
            return true;
        }
        return false;
    }
}

